package p270jp.pxv.android.pixivision;

import android.os.Bundle;
import android.os.Parcelable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.BackStackRecord;
import java.util.Objects;
import p047bg.C1124a;
import p089d.C2419a;
import p134ei.AnalyticsAction;
import p134ei.AnalyticsScreenName;
import p134ei.PixivAnalytics;
import p165fo.Subscribe;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.PixivisionActivity;
import p270jp.pxv.android.event.ShowPixivisionEvent;
import p270jp.pxv.android.legacy.constant.PixivisionCategory;
import p314lg.ActivityPixivisionListBinding;
import p325m0.MutabilityOwnership;
import p550uk.AbstractActivityC6632b;
import p550uk.PixivisionRecyclerFragment;
import p603wm.Tuples;

/* compiled from: PixivisionListActivity.kt */
/* renamed from: jp.pxv.android.pixivision.PixivisionListActivity */
/* loaded from: classes2.dex */
public final class PixivisionListActivity extends AbstractActivityC6632b {

    /* renamed from: b0 */
    public ActivityPixivisionListBinding f19284b0;

    /* renamed from: c0 */
    public PixivisionCategory f19285c0;

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        ViewDataBinding d = DataBindingUtil.m11369d(this, R.layout.activity_pixivision_list);
        MutabilityOwnership.m3746l(d, "setContentView(this, R.l…activity_pixivision_list)");
        this.f19284b0 = (ActivityPixivisionListBinding) d;
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6524f(AnalyticsScreenName.PIXIVISION_LIST, null);
        Parcelable parcelableExtra = getIntent().getParcelableExtra("PIXIVISION_CATEGORY");
        if (parcelableExtra != null) {
            PixivisionCategory pixivisionCategory = (PixivisionCategory) parcelableExtra;
            this.f19285c0 = pixivisionCategory;
            int ordinal = pixivisionCategory.ordinal();
            if (ordinal == 0) {
                ActivityPixivisionListBinding u0Var = this.f19284b0;
                if (u0Var != null) {
                    C1124a.m10197Q(this, u0Var.f22301s, R.string.pixivision_list);
                } else {
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
            } else if (ordinal == 1) {
                ActivityPixivisionListBinding u0Var2 = this.f19284b0;
                if (u0Var2 != null) {
                    C1124a.m10197Q(this, u0Var2.f22301s, R.string.pixivision_manga_list);
                } else {
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
            }
            BackStackRecord cVar = new BackStackRecord(m11131K0());
            PixivisionRecyclerFragment.C6634a aVar = PixivisionRecyclerFragment.f28282r;
            PixivisionCategory pixivisionCategory2 = this.f19285c0;
            if (pixivisionCategory2 != null) {
                Objects.requireNonNull(aVar);
                PixivisionRecyclerFragment fVar = new PixivisionRecyclerFragment();
                fVar.setArguments(C2419a.m7858f(new Tuples("PIXIVISION_CATEGORY", pixivisionCategory2)));
                cVar.m11165j(R.id.fragment_container, fVar);
                cVar.mo11171d();
                return;
            }
            MutabilityOwnership.m3737u("pixivisionCategory");
            throw null;
        }
        throw new IllegalArgumentException("Required value was null.".toString());
    }

    @Subscribe
    public final void onEvent(ShowPixivisionEvent showPixivisionEvent) {
        MutabilityOwnership.m3745m(showPixivisionEvent, "event");
        PixivisionCategory pixivisionCategory = this.f19285c0;
        if (pixivisionCategory != null) {
            int ordinal = pixivisionCategory.ordinal();
            if (ordinal == 0) {
                this.f18757A.m6527c(8, AnalyticsAction.VIEW_VIA_ALL_LIST, showPixivisionEvent.getPixivision().getArticleUrl());
            } else if (ordinal == 1) {
                this.f18757A.m6527c(8, AnalyticsAction.VIEW_VIA_MANGA_LIST, showPixivisionEvent.getPixivision().getArticleUrl());
            }
            this.f18757A.m6527c(8, AnalyticsAction.VIEW_VIA_LIST, showPixivisionEvent.getPixivision().getArticleUrl());
            startActivity(PixivisionActivity.m4774e1(this, showPixivisionEvent.getPixivision()));
            return;
        }
        MutabilityOwnership.m3737u("pixivisionCategory");
        throw null;
    }
}
